#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableAutoChessSeriesRoundDao:DaoBase<TableAutoChessSeriesRound>
    {
        public override string GetFileName()
        {
            return "TableAutoChessSeriesRound.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableAutoChessSeriesRound>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableAutoChessSeriesRound model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.seriesRound)) UnityEngine.Debug.LogError("数据表id重复:TableAutoChessSeriesRound->id: " + model.seriesRound);
            #endif
            cachePrimaryInt[model.seriesRound] = model;
        }
        protected override TableAutoChessSeriesRound ParseRowData(string[] rowData)
        {
            TableAutoChessSeriesRound data = new TableAutoChessSeriesRound();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.seriesRound = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.winGold = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.loseGold = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.winDes = rowData[3];
            }
            return data;
        }
    }
}
